﻿//
// Created: 2018/9/14
// Author: chenqiang
//
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Model.WXshopBuiness;

namespace Model.WXshopBuiness.Map
{
    internal  class AddressMap:EntityTypeConfiguration<Address>    
    {
        public AddressMap()
        {
             this.ToTable("Address");
             this.HasKey(i => new { i.AddressID });
             this.Property(i => i.AddressID).HasColumnName("AddressID");                     
             this.Property(i => i.Receiver).HasColumnName("Receiver");                     
             this.Property(i => i.Phone).HasColumnName("Phone");                     
             this.Property(i => i.Area).HasColumnName("Area");                     
             this.Property(i => i.DetailAddress).HasColumnName("DetailAddress");                     
             this.Property(i => i.Tag).HasColumnName("Tag");                     
             this.Property(i => i.IsDefault).HasColumnName("IsDefault");                     
             this.Property(i => i.UserId).HasColumnName("UserId");                     
             this.Property(i => i.CreateTime).HasColumnName("CreateTime");                     
             this.Property(i => i.Enable).HasColumnName("Enable");                     
             this.Property(i => i.PostCode).HasColumnName("PostCode");                     
             this.Property(i => i.SortIndex).HasColumnName("SortIndex");
             this.Property(i => i.Sheng).HasColumnName("Sheng");
             this.Property(i => i.Shi).HasColumnName("Shi");
             this.Property(i => i.QuYu).HasColumnName("QuYu");
        }   
    }
    
     public static class AddressMapExtensions
    {
        public static void UserAddressMap(this DbModelBuilder pModelBuilder)
        {
            pModelBuilder.Configurations.Add(new AddressMap());
        }
    }
}